import { Injectable } from '@nestjs/common';
import { CreateWorkerDto } from './dto/create-worker.dto';
import { UpdateWorkerDto } from './dto/update-worker.dto';
import { CrudService } from '../../common/crud/crud.service';
import { PrismaService } from 'nestjs-prisma';

@Injectable()
export class WorkerService extends CrudService {
  constructor(readonly prisma: PrismaService) {
    super(prisma, 'worker');
  }

  findAll() {
    return this.prisma.worker.findMany({
      where: {
        disabled: false,
      },
      select: {
        id: true,
        code: true,
        name: true,
      },
    });
  }
}
